package www.m01.springcloud.domains;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * Rs
 *
 * @author hyr
 * @date 2022/7/7
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Rs<T> {

  public static final Integer SUCCESS = 200;
  public static final Integer FAILED = 500;

  private Integer code;
  private String msg;
  private T data;

  public static Rs<String> success() {
    return new Rs<>(SUCCESS, "success");
  }

  public Rs(Integer code, String msg) {
    this(code, msg, null);
  }
}
